<template>
  <label for="locale">locale</label>
  <select v-model="$i18n.locale">
    <option>en</option>
    <option>zh</option>
  </select>
  <p>message: {{ t('hello') }} </p>
  <br/>
  origin message: {{ $t("hello") }}
</template>


<script>

import {useI18n} from "vue-i18n";

export default {
  name: 'App',
  setup(){
    const I18n = useI18n()
    let {t, locale} = I18n;
    return {t}
  }
}
</script>


<i18n>
{
  "en": {
    "hello": "hello world! 2"
  },
  "zh": {
    "hello": "你好、世界！2"
  }
}
</i18n>
